function changes1()
{
    setCookie("bkgcolor", "1", 1440);
    $("body").css("background-color", "rgb(201,232,207)");
    $(".jumpbutton").css("background-color", "rgb(201,232,207)");
    $(".liuyan").css("border-bottom", "solid rgb(201,232,207) 3px");
}
function changes2()
{
    setCookie("bkgcolor", "2", 1440);
    $("body").css("background-color", "#6950a1");
    $(".jumpbutton").css("background-color", "#6950a1");
    $(".liuyan").css("border-bottom", "solid #6950a1 3px");
}
function changes3()
{
    setCookie("bkgcolor", "3", 1440);
    $("body").css("background-color", "#007947");
    $(".jumpbutton").css("background-color", "#007947");
    $(".liuyan").css("border-bottom", "solid #007947 3px");
}
function changes4()
{
    setCookie("bkgcolor", "4", 1440);
    $("body").css("background-color", "#8e7437");
    $(".jumpbutton").css("background-color", "#8e7437");
    $(".liuyan").css("border-bottom", "solid #8e7437 3px");
}
function changes5()
{
    setCookie("bkgcolor", "5", 1440);
    $("body").css("background-color", "#f58f98");
    $(".jumpbutton").css("background-color", "#f58f98");
    $(".liuyan").css("border-bottom", "solid #f58f98 3px");
}
function changes6()
{
    setCookie("bkgcolor", "6", 1440);
    $("body").css("background-color", "#7d5886");
    $(".jumpbutton").css("background-color", "#7d5886");
    $(".liuyan").css("border-bottom", "solid #7d5886 3px");
}
function changes7()
{
    setCookie("bkgcolor", "7", 1440);
    $("body").css("background-color", "#fdb933");
    $(".jumpbutton").css("background-color", "#fdb933");
    $(".liuyan").css("border-bottom", "solid #fdb933 3px");
}
function checkbkgcolor()
{
    location.reload();
}
window.onload = function ()
{
    $("#bk1").click(function ()
    {
        changes1();
        checkbkgcolor();
    }
    );
    $("#bk2").click(function ()
    {
        changes2();
        checkbkgcolor();
    }
    );
    $("#bk3").click(function ()
    {
        changes3();
        checkbkgcolor();
    }
    );
    $("#bk4").click(function ()
    {
        changes4();
        checkbkgcolor();
    }
    );
    $("#bk5").click(function ()
    {
        changes5();
        checkbkgcolor();
    }
    );
    $("#bk6").click(function ()
    {
        changes6();
        checkbkgcolor();
    }
    );
    $("#bk7").click(function ()
    {
        changes7();
        checkbkgcolor();
    }
    );
    $(".jumpbutton").click(function ()
    {
        $page = $(".jump").val();
        $(location).attr('href', 'homepage.php?page=' + $page);
    }
    );
    $("#publishbutton").click(function ()
    {
        if ($("#publishtext").val() == "")
        {
            alert("留言内容不能为空");
        }
        else
        {
            $("#publishbutton").attr("type", "submit");
        }
    }
    );
    $("#replybutton1").click(function ()
    {
        $('#replytext1').css('display', 'inline');
    }
    );
    $("#replybutton2").click(function ()
    {
        $('#replytext2').css('display', 'inline');
    }
    );
    $("#replybutton3").click(function ()
    {
        $('#replytext3').css('display', 'inline');
    }
    );
    $("#replybutton4").click(function ()
    {
        $('#replytext4').css('display', 'inline');
    }
    );
    $("#replybutton5").click(function ()
    {
        $('#replytext5').css('display', 'inline');
    }
    );
    $("#replytext1").bind('input propertychange', function ()
    {
        $('#replybutton1').attr('type', 'submit');
    }
    );
    $("#replytext2").bind('input propertychange', function ()
    {
        $('#replybutton2').attr('type', 'submit');
    }
    );
    $("#replytext3").bind('input propertychange', function ()
    {
        $('#replybutton3').attr('type', 'submit');
    }
    );
    $("#replytext4").bind('input propertychange', function ()
    {
        $('#replybutton4').attr('type', 'submit');
    }
    );
    $("#replytext5").bind('input propertychange', function ()
    {
        $('#replybutton5').attr('type', 'submit');
    }
    );
    $("#replybutton6").click(function ()
    {
        $('#replytext6').css('display', 'inline');
    }
    );
    $("#replybutton7").click(function ()
    {
        $('#replytext7').css('display', 'inline');
    }
    );
    $("#replybutton8").click(function ()
    {
        $('#replytext8').css('display', 'inline');
    }
    );
    $("#replybutton9").click(function ()
    {
        $('#replytext9').css('display', 'inline');
    }
    );
    $("#replybutton10").click(function ()
    {
        $('#replytext10').css('display', 'inline');
    }
    );
    $("#replytext6").bind('input propertychange', function ()
    {
        $('#replybutton6').attr('type', 'submit');
    }
    );
    $("#replytext7").bind('input propertychange', function ()
    {
        $('#replybutton7').attr('type', 'submit');
    }
    );
    $("#replytext8").bind('input propertychange', function ()
    {
        $('#replybutton8').attr('type', 'submit');
    }
    );
    $("#replytext9").bind('input propertychange', function ()
    {
        $('#replybutton9').attr('type', 'submit');
    }
    );
    $("#replytext10").bind('input propertychange', function ()
    {
        $('#replybutton10').attr('type', 'submit');
    }
    );
}
